<?php 
namespace Admin\Model;
use Think\Model;

class CommentsModel extends Model{
		//查询总条数
	public function getCount()
	{
		$total=$this->table('comments c,
		    user     u ')
				->where(" c.uid=u.id")
				->count();
			//echo $total;exit;
			return $total;
	}
	public function getAll($limit)
	{
		$list=$this
				->field('c.id,
					c.text,
					c.status,
					c.comtime,
					u.username ')
				->table('comments c, user     u ')
				->where("c.uid=u.id")
				->limit($limit)
				->select();
			//var_dump($goods_list);exit;
			return $list;
	}

}
?>